-- GENERATED SPELL FOR [Razorfen Beast Trainer] --


function spell0_4531(pUnit, Event) --@Frost Shot,n/a--
pUnit:FullCastSpellOnTarget(6984,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_4531', 10316, 1)
end

function spell1_4531(pUnit, Event) --@Shoot,n/a--
pUnit:FullCastSpellOnTarget(6660,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_4531', 588, 1)
end

function spell2_4531(pUnit, Event) --@Summon Tamed Battleboar,Self--
pUnit:FullCastSpellOnTarget(8274,pUnit)
pUnit:RegisterEvent('Sorts_4531', 649, 1)
end

function Sorts_4531(pUnit, Event)
local choix_sorts_4531 = math.random(0, 2)
if choix_sorts_4531 == 0 then
pUnit:RegisterEvent('spell0_4531', 1, 1)
end
if choix_sorts_4531 == 1 then
pUnit:RegisterEvent('spell1_4531', 1, 1)
end
if choix_sorts_4531 == 2 then
pUnit:RegisterEvent('spell2_4531', 1, 1)
end
end

function mob4531_Action(pUnit, Event)
pUnit:RegisterEvent('Sorts_4531', math.random(1500, 3000), 1)
end

function mob4531_Leave(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob4531_Kill(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob4531_Die(pUnit, Event)
pUnit:RemoveEvents();
end

RegisterUnitEvent(4531, 1, 'mob4531_Action')
RegisterUnitEvent(4531, 2, 'mob4531_Leave')
RegisterUnitEvent(4531, 3, 'mob4531_Kill')
RegisterUnitEvent(4531, 4, 'mob4531_Die')
